<template>
	<view class="content">
		<button class="btn" @click="handleCLICK">点击跳转到司机端接单页面</button>
	</view>
</template>

<script>
// 点击直接跳转司机端
import { getTenantId } from '@/utils/auth';
export default {
	name: 'jump',
	data() {
		return { tenantId: '', planNo: '' };
	},
	methods: {
		handleCLICK() {
			// var ysjhData = uni.getStorageSync('ysjhData');
			// console.log('我要跳转了--接单页面', getTenantId(), ysjhData);
			uni.navigateToMiniProgram({
				appId: 'wx509f810f5fb82353',
				path: `/pages/order-receiving/order-receiving?tenantId=` + this.tenantId + `&planId=` + this.planNo,
				envVersion: 'trial',
				success(res) {
					// 打开成功
					console.log('跳转小程序成功！', res);
				}
			});
		}
	},
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function (options) {
		console.log(options, '-----AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
		console.log('onLoad--接单页面', getTenantId(), uni.getStorageSync('ysjhData'));
		//TODO ysjhData缓存是否要清除
		this.tenantId = options.tenantId;
		this.planNo = options.planNo;
		this.handleCLICK()
		// uni.navigateToMiniProgram({
		// 	appId: 'wx509f810f5fb82353',
		// 	path: `/pages/order-receiving/order-receiving?tenantId=` + this.tenantId + `&planId=` + this.planNo,
		// 	//develop开发版；trial体验版；release正式版
		// 	// extraData: {
		// 	// 	// 传递的参数，可选
		// 	// 	tenantId: getTenantId(),
		// 	// 	ysjhData: '999'
		// 	// },
		// 	envVersion: 'trial',
		// 	success(res) {
		// 		// 打开成功
		// 		console.log('跳转小程序成功！', res);
		// 	}
		// });
	}
};
</script>

<style lang="scss">
.content {
	height: 100vh;
	width: 100vw;
	display: flex;
	align-items: center;
	justify-content: center;
	.btn{
		height: 50px;
		width: 60%;
	}
}
</style>
